<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main"/>
        <title>${postInstance.title}--修改博文</title>
    </head>
    <body>
            <div class="body">
                <h1>修改${postInstance.title}</h1>
                <g:if test="${flash.message}">
                    <div class="message">${flash.message}</div>
                </g:if>
                <g:hasErrors bean="${postInstance}">
                    <div class="errors">
                        <g:renderErrors bean="${postInstance}" as="list"/>
                    </div>
                </g:hasErrors>
                <g:form action="update" method="post">
                    <input type="hidden" name="id" value="${postInstance?.id}"/>
                    <div class="dialog">
                        <table class="full">
                            <tbody>

                                <tr class="prop">
                                    <td valign="top" class="name">
                                        <label for="title"><div class="label">标题：</div></label>
                                    </td>
                                    <td valign="top" class="value ${hasErrors(bean: postInstance, field: 'title', 'errors')}">
                                        <input type="text" class="inputStyle standardFormInput" id="title" name="title" value="${fieldValue(bean: postInstance, field: 'title')}"/>
                                    </td>
                                </tr>

                                <tr class="prop">
                                    <td valign="top" class="name">
                                        <label for="content"><div class="label">内容：</div></label>
                                    </td>
                                    <td valign="top" class="value ${hasErrors(bean: postInstance, field: 'content', 'errors')}">
                                        <fckeditor:editor
                                                name="content"
                                                width="100%"
                                                height="400"
                                                toolbar="Standard"
                                                fileBrowser="default">
                                            ${postInstance.content}
                                        </fckeditor:editor>
                                    </td>
                                </tr>
                                <jsec:hasRole  in="['TEACHER']">
                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="classes">同时发布到：</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'classes', 'errors')}">
                                            <g:select name="classesid" from="${classeSites}" optionKey="hostId" value="${postInstance.classesid}" noSelection="['0':'私人博客']"/>
                                        </td>
                                    </tr>
                                </jsec:hasRole>
                            </tbody>
                        </table>
                        <div><g:actionSubmit class="buttonStyle" value="修改发布" action="update"/></div>
                    </div>
                </g:form>
            </div>
        </div>
    </body>
</html>
